<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    var num = parseInt(prompt('请输入一个数字'));
    for (var i = 2; i < num; i++) {
      if (num % i == 0) {
        alert('该数不是质数');
      }else{
        alert('该数是质数')
      }
    }

  </script>
</head>
<body>
  
</body>
</html>